package com.listener;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;

@WebListener
public class MySessionListener implements HttpSessionAttributeListener {
    /**
     * 创建 session 对象
     */
    @Override
    public void attributeAdded(HttpSessionBindingEvent event) {
        System.out.println(">>> 我要往 session 里面添加东西咯 " + event.getName());
    }

    @Override
    public void attributeRemoved(HttpSessionBindingEvent event) {

    }

    @Override
    public void attributeReplaced(HttpSessionBindingEvent event) {

    }
}
